<?php

class CaleComponent extends Object {
    
    function startup(&$controller)
    {
        $this->controller =& $controller;        
    }

  function initCalendar()
    {
        // include required vendors
        vendor('jscalendar-1.0/calendar');
        $calendar_lang = 'es';
       // debug ($this->controller->base );exit;
        $calendar = new DHTML_Calendar($this->controller->base .
        '/js/jscalendar-1.0/', $calendar_lang, 'calendar-blue', false);
        //debug($calendar->get_load_files_code());
        $this->controller->set('calendar', $calendar);
        $this->controller->set('headers', $calendar->get_load_files_code());
        
         $calendarOptions = array(
                'firstDay'       => 1, // show Monday first
                'showsTime'      => true,
                'showOthers'     => true,
                'ifFormat'       => '%Y-%m-%d ',
                'daFormat'       => '%Y-%m-%d ',
                'timeFormat'     => '24',
                'align'          => 'cl'
                
            );


          //$calendar->make_input_field($calendarOptions); 
          $field_attributes=array('name'=>'prova');
          $Test=$calendar->make_input_fieldVar($calendarOptions,$field_attributes); 
        $this->controller->set('Test',$Test);
        //debug($Test);
        
        //echo $calendar->make_input_field();

    } 
}

?>
